// 正则JS

const phoneCheck=(val)=>{
    return /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/.test(val);
}

const idCardCheck=(val)=>{
    return /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/.test(val);
}

const normalCheck=(val)=>{
    return /^[\u4E00-\u9FA5A-Za-z0-9_:]+$/.test(val);

// }return /^[\u4E00-\u9FA5A-Za-z0-9_]+$/.test(val);
}
const dateCheck=(val)=>{
    return /^\d{4}[-|\/]\d{1,2}[-|\/]\d{1,2}$/.test(val);
}

const timeCheck=(val)=>{
    return  /^\d{2}:\d{2}$/.test(val);
}

const numberCheck=(val)=>{
    return /^\d+$/.test(val);
}
module.exports={phoneCheck,idCardCheck,normalCheck,dateCheck,timeCheck,numberCheck};